<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
 <%@ page import="com.exam.business.*"%>
 <%@ page import="com.exam.domain.*"%>
<%Student[] stuSet=Manager.GetAllStu();%>
<%String param=(String)request.getParameter("param"); %>

<script type="text/javascript">
function confirmDel()
{
	if(confirm("确定删除?"))
	{
		<%request.getSession().setAttribute("confirmDelStu","1"); %>
	}
}
</script>

<title>E-Exam</title>
</head>
<body>
<p><img src="e-exam.gif" width="680" height="170" /></p>
 <%request.getSession().setAttribute("stuFromWhere","2"); %>
<table width="581" height="199" border="1">
  <tr>
      <td width="140">ID</td>
    <td width="140">学生姓名</td>
     <td width="140">学院</td>
    <td width="140">入学年份</td>
     <td width="140">性别</td>
    <td width="144">修改</td>
    <td width="144">删除</td>
  </tr>
  <%for(int i=0;i<stuSet.length;i++) {%>
  <form id="form1" name="form1" method="post" action="servlet/UpdateStuServlet" ><tr>
      <td><%=stuSet[i].getS_id()%></td>
      <td><%=stuSet[i].getS_name()%></td>
      <td><%=stuSet[i].getS_dept_name()%></td>
      <td><%=stuSet[i].getGrade()%></td>
      <td><%out.print(stuSet[i].getS_sex().equals("male")?"男":"女");%></td>
  
    <td>    
        <input name="Submit" type="submit" value="修改" />
        <input type="hidden" name="UpdateID" value="<%=stuSet[i].getS_id()%>" >
    </td>
  </form>
  
  <form id="form2" name="form2" method="post" action="servlet/DelStuServlet">
    <td>
      <input name="Submit" type="submit" value="删除"onclick="confirmDel();">
   	  <input type="hidden" name="delID" value="<%=stuSet[i].getS_id()%>" >
    </td>
  </tr></form>
  <%} %>
</table>

<p><a href="admin_s.jsp">返回学生管理中心</a></p>
<script type="text/javascript">
	if(<%=param%>==6)	alert("修改成功！");
	if(<%=param%>==7)	alert("删除成功！");
</script>
</body>
</html>
